<?php
?>
<section id="maincontent" class="singlecab">
            <section class="cabheading" style="height:240px; border: 1px solid #0296C7;">
               <div id = "offer-title" style=" 15px;color: black;font-size: 1.3em;">
                <?php echo $this->Model['ProductInform']->Title?>
               </div>
               <div id = "offer-product" style="height: 215px;">
               		<div id="view-offer" style="float:left; height: 215px;width: 180px;">
               			<div id= "offer-image" style="height: 170px;background-color: black; border: 1px solid ;">
               				<a href="#" ><img height="170px" width="180px" src="/Upload/Offer/<?php echo $this->Model['ProductInform']->Image;?>"/></a>
               			</div>
               			<div id= "rating" style="height: 20px;background-color: #08d72d;border:1px solid gray; margin-top: 9px;-webkit-border-radius:3px;">
               				<div style="height:20px; width:<?php  $a =($this->Model['ProductInform']->hasPart)*180/($this->Model['ProductInform']->NumberOfPart);echo $a; ?>px; background-color:#fe2d2c; ">
               				</div>
               				<div id="redarea" style="color: white;text-align: middle;"></div>
               			</div>
               		</div>
               		<div id="view-descrip" style="float:right; height: 215px;width: 520px;">
               			<div id = "description" style="background-color: white; height: 170px;border: 1px solid gray;-webkit-border-radius:3px; ">
               				<div id="des" style="color: blue; margin: 12px 10px 10px 10px;">
	               				<h3 class="description" style="font-size: 1.3em;">
	                             <?php echo $this->Model['ProductInform']->Description?> </h3>
                              </div>
               			</div>
               			<div id="under-descrip" style="height: 20px;margin-top: 9px;">
	               			<div id="author" style="height:20px; width:160px;float:left; margin-left: 10px; color: #0084B4;font-size: 1.2em;text-align: center; ">
	               				<a href="/Profile?id=<?php echo $this->Model['ProductInform']->OwnerID?>"> <?php echo $this->Model['ProductInform']->OwnerName?></a>
	               			</div>
	               			<div id="datecreated" style="height:20px; width:180px; float:right;color: #0084B4;font-size: 1.2em;text-align: right; margin-right: 10px;">
	               				6 giờ trước
	               			</div>
               			</div>
               		</div>
               </div>
            </section>
            
            <section class="singlecabmain">
                <section class="communitycomment">
                    <section class="wrap">
                        <h2><span class="sprite icon-comment-simple">&nbsp;</span>Bình luận (<?php echo $this->ViewData['numCmt']?>)</h2>
                           <?php foreach ($this->Model['ListConversation'] as $conversation) {?>                                                      
                            <section class="entry parent-entry" id="comment_606740">
                                <section class="entry-content ">
                                <section style="width: 45px;height: 70px;float: left;">
                                	<img height="45px" width="45px;" src="/Upload/User/Avatar/<?php echo $conversation->FirstAvatar?>" class="avatar">
                                    <?php if ($this->ViewData['userType']==1){
                                    			if($conversation->checked==false){?>
                                    			<form id="commentboxmain" action="/Exchange?offerID=<?php echo $this->ViewData['offerId']?>" method="post">
                                    			<input style="width: 45px;height: 25px;background:url('../Content/Image/on.png') " type="submit" class="btn mainbtn" value="" name="sbm_Conversa">
                                    			<input type="hidden" name="conversaID" value="<?php echo $conversation->ID?>">
                                    			</form>
                                    			<?php } else { ?>
                                    			<img style="border: 1px solid #c1c1c1;" height="22px" width="45px;" src="../Content/Image/off.png"/>
                                    			<?php }?>
                                    <?php } else{
                                    if ($conversation->checked==false) {?>
                                    	<img style="border: 1px solid #cacaca;margin: 0;" height="25px" width="45px;" src="../Content/Image/on.png"/>
                                    	<?php }
                                    	else {?>
                                    	<img style="border: 1px solid #cacaca;margin: 0;" height="22px" width="40px;" src="../Content/Image/off.png"/>
                                    <?php }?>
                                    
                                    <?php }?>
                                    </section>
                                	
                                      <section  style="width: 650px;float: right;" class="entry-text">
                                        <div class="textwrap" style="font-size: 1.3em;">
                                             <?php echo $conversation->FirstContent;?>
                                        </div>
                                        <p class="entry-details">
                                            <a href="/Profile?id=<?php echo $conversation->UserAccountFirst?>" class="author"><?php echo $conversation->UserName;?> </a>
                                            <span class="datetime">6 giờ trước</span>
                                           <span class="fright adminaction"></span>
                                        </p>
                                    </section>
                                    <div class="clear"></div>
                                </section>
                                <?php foreach ($conversation->listComments as $comment) {?>
                                <section class="sub-entries">
                                     <section class="entry-content  ">
                                            <img height="45px" width="45px;"src="/Upload/User/Avatar/<?php echo $comment->Avatar?>" class="avatar">
                                            <section class="entry-text">
                                                <div class="textwrap"style="font-size: 1.3em;">
                                                    <?php echo $comment->Content?>
                                                </div>
                                                <!--<span class="rate">+17</span>-->
                                                <p class="entry-details">
                                                    <a href="/Profile?id=<?php echo $comment->AccountID?>" class="author"><?php echo $comment->CommenterName?></a> -
                                                    <span class="datetime">6 giờ trước</span>
                                                </p>
                                            </section>
                                            <div class="clear"></div>
                                        </section>
                                  </section>
                                  <?php }?>
                                  <?php if(($conversation->IsCommenter == true)||($this->ViewData['userType']==1)){?>
                                  <section class="sub-entries">
	                                 <section class="reply-content" id="reply-comment-inline-block" style="display: block; ">
		                                <form action="/Exchange?offerID=<?php echo $this->ViewData['offerId']?>" method="post">
		                                <img height="45px" width="45px;"src="/Upload/User/Avatar/<?php echo $this->ViewData['Avatar']; ?>" class="avatar">
		                                <textarea placeholder="Nhập bình luận" maxlength="1000" name="comment"></textarea>
		                                <div class="clear"></div>
		                                <div class="controls">
		                                    <input type="submit" value="Gửi" name="sbm_comment">
		                                    <input type="hidden" name="converID" value="<?php echo $conversation->ID?>">		                                    
		                                </div>
		                                </form>
		                                <div class="clear"></div>
									</section>
								</section>
                            <?php }?>
                            </section>                            
                            <?php }?>                   
                    </section>
                    <?php if (($this->ViewData['userType']==1)||($this->ViewData['newUser'])==true) {?>                    	
                    <section class="replycomment">
                        <form id="commentboxmain" action="/Exchange?offerID=<?php echo $this->ViewData['offerId']?>" method="post">
                             <img src="/Upload/User/Avatar/<?php echo $this->ViewData['Avatar']; ?>" class="avatar">
                                <textarea placeholder="Nhập bình luận" maxlength="1000" name="firstContent"></textarea>                                                        
                            <p><em class="desc"><span>1000</span>/1000 kí tự</em>
                            <input type="submit" class="btn mainbtn" value="Gửi" name="sbm_Conver"></p>
                        </form>                       
                    </section> 
                    <?php }?>                   
                </section>
            </section>            
        </section>